home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 4 / ETO Development Tools 4.iso / Essentials / MacApp Documentation / MacApp.TECH$ Archives / 1989 / Nov 89 / 0003-Re A bug with Suitca-Nov89 < prev    next >
Encoding:
Text File  |  1991-03-06  |  2.2 KB  |  55 lines  |  [TEXT/GEOL]

  1. Item forwarded  by  A33          to A34
  2.  
  3. Item forwarded  by  NORVELL.J    to SHAYER1
  4.  
  5. Item    8698711                         1-Nov-89        13:26
  6.  
  7. From:   D0377                           Software Supply, Steve Brecher,PRT
  8.  
  9. To:     NORVELL.J                       Norvell, Joel
  10.  
  11. cc:     MACAPP.TECH$                    MacApp Technical
  12.         DISHON.D                        Dishon, Danny
  13.         FIFTHGENSYS                     Fifth Generation Sys, S Nauman,PRT
  14.  
  15. Sub:    Re: A bug with Suitcase.
  16.  
  17. Joel,
  18.  
  19. Fixed in Suitcase II 1.2.6, coming soon.  To work around the problem, I suggest
  20. you change
  21.  
  22.    aMenu := GetMenu(rsrcID);
  23.    { Don't die because resource not found - just return NIL handle }
  24.    FailResError;
  25.  
  26. to
  27.    aMenu := GetMenu(rsrcID);
  28.    { Don't die because resource not found - just return NIL handle }
  29.    IF aMenu = nil { test works around Suitcase II 1.2.5 problem }
  30.         FailResError;
  31.  
  32. The additional test is harmless and can be left in after Suitcase II 1.2.6 is
  33. in use.
  34.  
  35. Technical explanation of the problem:  GetMenu calls GetResInfo on the menu
  36. definition handle field of the menu record to see whether it’s really an MDEF;
  37. if it isn’t, GetMenu assumes that the field hasn’t been filled in yet with the
  38. MDEF handle and proceeds to get the MDEF.  For font menus, Suitcase II
  39. substitutes a non-resource MDEF for the real one.  If Suitcase II’s GetResInfo
  40. patch sees that the ROM GetResInfo returns -192, it makes further checks to see
  41. if the call is from GetMenu and if the handle is the substitute MDEF handle.
  42. If these checks pass, the patch returns 'MDEF' to GetMenu as the resource type.
  43. But the patch does not clear ResErr.  Only on the second or subsequent call to
  44. GetMenu for a particular menu will this be a problem, as on the first call
  45. Suitcase II will not have substituted the MDEF yet.  This problem has not been
  46. brought to light before because it is rare for applications to both (1) call
  47. GetMenu multiple times on the same menu and (2) check ResError after the call.
  48.  
  49. It's possible that the times your program worked (i.e., when you were using
  50. debugger calls) you were looking the first time GetMenu was called for this
  51. particular menu.
  52.  
  53.       Steve
  54.  
  55.